package com.kfm.servlet.day01;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet("/servlet1")
public class MyServlet1 extends GenericServlet {

    @Override
    public void init() throws ServletException {
        // 我们要在初始化servlet时执行的代码
        System.out.println("MyServlet1 :: init()");
    }

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        System.out.println("MyServlet1 :: service()");
    }
}
